<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <base href="<%=basePath%>"/>    
    <title>群聚网</title>    
	<meta http-equiv="pragma" content="no-cache"/>
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
	<meta http-equiv="description" content="This is my page"/>
	 <link rel="stylesheet" href="/css/pager.css" type="text/css"></link>
	<script type="text/javascript" src="/js/jquery-1.4.4.min.js"></script>

	<script src="js/formValidator-4.1.0.js" type="text/javascript" charset="UTF-8"></script>
	<script src="js/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
	<script language="javascript" src="js/DateTimeMask.js" type="text/javascript"></script>

	<script type="text/javascript" src="/js/pageView.js"></script> 
	<script src="js/taobao.js"></script>
	<script src="/js/jquery.KinSlideshow-1.2.1.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="/js/uploadify/swfobject.js"></script>
	<script type="text/javascript" src="/js/uploadify/task_jquery.uploadify.v2.1.4.js"></script>
	<link href="/css/uploadify.css" type="text/css" rel="stylesheet" />
	<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({formID:"businessinfoForm",theme:"ArrowSolidBox",debug:false,submitOnce:true,
		onError:function(msg,obj,errorlist){
			$("#errorlist").empty();
			$.map(errorlist,function(msg){
				$("#errorlist").append("<li>" + msg + "</li>")
			});
			alert(msg);
		},
		submitAfterAjaxPrompt : '有数据正在异步验证，请稍等...',
		onShowClass : "",
		onFocusClass : "",
		onCorrectClass : ""
	});
	$("#us").formValidator({onShow:"请输商户名称",onFocus:"用户名至少2个字符,最多20个字符",onCorrect:"该用户名可以注册"}).inputValidator({min:2,max:20,onError:"你输入的用户名非法,请确认"})//.regexValidator({regExp:"username",dataType:"enum",onError:"用户名格式不正确"})
	$("#zsxm").formValidator({onShow:"请输真实姓名",onFocus:"用户名至少2个字符,最多10个字符",onCorrect:"该用户名可以注册"}).inputValidator({min:2,max:10,onError:"你输入的用户名非法,请确认"})//.regexValidator({regExp:"username",dataType:"enum",onError:"用户名格式不正确"})
	$("#password1").formValidator({onShow:"请输入密码",onFocus:"至少1个长度",onCorrect:"密码合法"}).inputValidator({min:1,empty:{leftEmpty:false,rightEmpty:false,emptyError:"密码两边不能有空符号"},onError:"密码不能为空,请确认"});
	$("#password2").formValidator({onShow:"输再次输入密码",onFocus:"至少1个长度",onCorrect:"密码一致"}).inputValidator({min:1,empty:{leftEmpty:false,rightEmpty:false,emptyError:"重复密码两边不能有空符号"},onError:"重复密码不能为空,请确认"}).compareValidator({desID:"password1",operateor:"=",onError:"2次密码不一致,请确认"});
	$(":radio[name='xb_one']").formValidator({tipID:"sexTip",onShow:"请选择你的性别",onFocus:"没有第三种性别了，你选一个吧",onCorrect:"输入正确",defaultValue:["1"]}).inputValidator({min:1,max:1,onError:"性别忘记选了,请确认"});//.defaultPassed();
	$("#nl").formValidator({autoModify:true,onShow:"请输入的年龄（1-99岁之间）",onFocus:"只能输入1-99之间的数字哦",onCorrect:"恭喜你,你输对了"}).inputValidator({min:1,max:99,type:"value",onErrorMin:"你输入的值必须大于等于1",onError:"年龄必须在1-99之间，请确认"}).defaultPassed();
	$("#csny").formValidator({onShow:"请输入的出生日期",onFocus:"请输入的出生日期，不能全部是0哦",onCorrect:"你输入的日期合法"}).inputValidator({min:"1900-01-01",max:"2000-01-01",type:"date",onError:"日期必须在\"1900-01-01\"和\"2000-01-01\"之间"}).defaultPassed();
	$("#s_f_z_h").formValidator({ajax:true,onShow:"请输入15或18位的身份证",onFocus:"输入15或18位的身份证",onCorrect:"输入正确"}).functionValidator({fun:isCardID});
	$("#email").formValidator({onShow:"请输入邮箱",onFocus:"邮箱6-100个字符,输入正确了才能离开焦点",onCorrect:"恭喜你,你输对了",defaultValue:"@"}).inputValidator({min:6,max:100,onError:"你输入的邮箱长度非法,请确认"}).regexValidator({regExp:"^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$",onError:"你输入的邮箱格式不正确"});
	$("#xueli").formValidator({onShow:"请选择商户类型",onFocus:"商户类型选择",onCorrect:"谢谢你的配合",defaultValue:"a"}).inputValidator({min:1,onError: "你是不是忘记选择商户类型!"}).defaultPassed();
	$("#ewjy").formValidator({onShow:"无论你输入什么都会提示你额外校验出错",onFocus:"如果你输入\"猫冬\"，额外校验就会成功",onCorrect:"额外校验成功"}).inputValidator({min:1,onError:"这里至少要一个字符,请确认"}).functionValidator({
	    fun:function(val,elem){
	        if(val=="猫冬"){
			    return true;
		    }else{
			    return "额外校验失败,想额外校验通过，请输入\"猫冬\""
		    }
		}
	});
	$("#Tel_country").formValidator({tipID:"teltip",onShow:"请输入国家区号",onFocus:"国家区号2位数字",onCorrect:"恭喜你,你输对了",defaultValue:"86"}).regexValidator({regExp:"^\\d{2}$",onError:"国家区号不正确"});
	$("#Tel_area").formValidator({tipID:"teltip",onShow:"请输入地区区号",onFocus:"地区区号3位或4位数字",onCorrect:"恭喜你,你输对了"}).regexValidator({regExp:"^\\d{3,4}$",onError:"地区区号不正确"});
	$("#Tel_number").formValidator({tipID:"teltip",onShow:"请输入电话号码",onFocus:"电话号码7到8位数字",onCorrect:"恭喜你,你输对了"}).regexValidator({regExp:"^\\d{7,8}$",onError:"电话号码不正确"});
	$("#Tel_ext").formValidator({tipID:"teltip",onShow:"请输入分机号码",onFocus:"分机号码1到5位数字",onCorrect:"恭喜你,你输对了"}).regexValidator({regExp:"^\\d{1,5}$",onError:"分机号码不正确"});
	$(":checkbox[name='xqah_one']").formValidator({tipID:"test3Tip",onShow:"请选择你的兴趣爱好（至少选一个）",onFocus:"你至少选择1个",onCorrect:"恭喜你,你选对了"}).inputValidator({min:1,onError:"你选的个数不对"});
	$(":checkbox[name='xqah_more']").formValidator({tipID:"test2Tip",onShow:"请选择你的兴趣爱好(至少选择2个,最多选择3个)",onFocus:"你至少选择2个,最多选择3个",onCorrect:"恭喜你,你选对了",defaultValue:["7","8"]}).inputValidator({min:2,max:3,onError:"你选的个数不对(至少选择2个,最多选择3个)"});
	$(":radio[name='aiguo']").formValidator({tipID:"aiguoTip",onShow:"爱国的人一定要选哦",onFocus:"你得认真思考哦",onCorrect:"不知道你爱不爱，反正你是选了",defaultValue:["4"]}).inputValidator({min:1,max:1,onError:"难道你不爱国？你给我选！！！！"}).defaultPassed();
	$("#shouji").formValidator({empty:true,onShow:"请输入你的手机号码，可以为空哦",onFocus:"你要是输入了，必须输入正确",onCorrect:"谢谢你的合作",onEmpty:"你真的不想留手机号码啊？"}).inputValidator({min:11,max:11,onError:"手机号码必须是11位的,请确认"}).regexValidator({regExp:"mobile",dataType:"enum",onError:"你输入的手机号码格式不正确"});;
	$("#lxdh").formValidator({empty:true,onShow:"请输入你的联系电话，可以为空哦",onFocus:"格式例如：0577-88888888",onCorrect:"谢谢你的合作",onEmpty:"你真的不想留联系电话了吗？"}).regexValidator({regExp:"^(([0\\+]\\d{2,3}-)?(0\\d{2,3})-)?(\\d{7,8})(-(\\d{3,}))?$",onError:"你输入的联系电话格式不正确"});
	$("#sjdh").formValidator({empty:true,onShow:"请输入你的手机或电话，可以为空哦",onFocus:"格式例如：0577-88888888或11位手机号码",onCorrect:"谢谢你的合作",onEmpty:"你真的不想留手机或电话了吗？"}).regexValidator({regExp:["tel","mobile"],dataType:"enum",onError:"你输入的手机或电话格式不正确"});
	$("#selectmore").formValidator({onShow:"按住CTRL可以多选",onFocus:"按住CTRL可以多选,至少选择2个",onCorrect:"谢谢你的合作",defaultValue:["0","1","2"]}).inputValidator({min:2,onError:"至少选择2个"});
	$("#ms").formValidator({onShow:"请输入你的描述",onFocus:"描述至少要输入10个汉字或20个字符",onCorrect:"恭喜你,你输对了",defaultValue:""}).inputValidator({min:20,onError:"你输入的描述长度不正确,请确认"});
	$("#xfts").formValidator({onShow:"请输入你的描述",onFocus:"描述至少要输入10个汉字或20个字符",onCorrect:"恭喜你,你输对了",defaultValue:""}).inputValidator({min:20,onError:"你输入的描述长度不正确,请确认"});
	$("#tsld").formValidator({onShow:"请输入你的描述",onFocus:"描述至少要输入10个汉字或20个字符",onCorrect:"恭喜你,你输对了",defaultValue:""}).inputValidator({min:20,onError:"你输入的描述长度不正确,请确认"});
	$("#shdz").formValidator({onShow:"请输入你的描述",onFocus:"描述至少要输入10个汉字或20个字符",onCorrect:"恭喜你,你输对了",defaultValue:""}).inputValidator({min:20,onError:"你输入的描述长度不正确,请确认"});
	$("#shzb").formValidator({onShow:"请输入你的描述",onFocus:"描述至少要输入10个汉字或20个字符",onCorrect:"恭喜你,你输对了",defaultValue:""}).inputValidator({min:20,onError:"你输入的描述长度不正确,请确认"});
	$("#shjs").formValidator({onShow:"请输入你的描述",onFocus:"描述至少要输入10个汉字或20个字符",onCorrect:"恭喜你,你输对了",defaultValue:""}).inputValidator({min:20,onError:"你输入的描述长度不正确,请确认"});
});
function test(obj)
{
	if(obj.value=="不校验身份证")
	{
		$("#sfzh").attr("disabled",true).unFormValidator(true);
		obj.value = "校验身份证";
	}
	else
	{
		$("#sfzh").attr("disabled",false).unFormValidator(false);
		obj.value = "不校验身份证";
	}
}
function test1(obj)
{
	var initConfig = $('body').data('1');
	if(obj.value=="全角字符当做1个长度")
	{
		initConfig.wideword = false;
		obj.value = "全角字符当做2个长度";
	}
	else
	{
		initConfig.wideword = true;
		obj.value = "全角字符当做1个长度";
	}
	$('body').data(obj.validatorgroup,initConfig);
}
</script>
  <script type="text/javascript">
  $(document).ready(function() {
		$('#file_upload_detail').uploadify({
			'uploader'  : 'js/uploadify/uploadify.swf',
		    'script'    : '/register.do?method=upload',
		    'cancelImg' : '/js/uploadify/cancel.png',
		    'buttonImg' : '/images/uploadPhoto_addPhoto_btn.gif',
		    'folder'    : '/uploads',
		    'queueID'   : 'taskFileDiv',
		    'auto'      : true,
		    'simUploadLimit' : 1,
			'removeCompleted': false,
		    'multi'		: true,
		    'queueSizeLimit' : 10,
		    'simUploadLimit' : 1,
			'removeCompleted': false,
		    'fileExt'   : '*.jpg;*.jpeg;*.gif;*.png;*.bmp',
			'fileDesc'  : 'Image Files (.JPG, .GIF, .PNG, .BMP)',
			'onComplete' : function (evt, queueID, fileObj, response, data) {
				//$("#imgName").val(response);
				//alert($("#imgName").val(response));
				//var newImgPath = '/images/houseImg/detail/' + response;
				//$("#imgTarget2").attr("src", newImgPath);
				//alert(response);
				//$("#imgName").val(response);
			}				
		});
	});
  function set_zlist(aid){
		$.post("/register.do?method=getzList",{aid:aid},
				function(data){
		  		    var id = document.getElementById("cityAdress");
			        while (id.childNodes.length > 0) {   
			            id.removeChild(id.childNodes[0]);
			        }
				$.each(data, function(i, item) {
		        $("#cityAdress").append("<option value="+item.id+">"+item.adressName+"</option>");
		        });
				},"json");
}	

  
	    //打开页面随机选择 切换方式（方向）,怕增大KinSlideshow.js文件 就没把随机切换写到里面。
		//使用时如有需要随机自己写在前面是一样的。而且还可以只固定随机切换哪几种。
		
		var moveStyle
		var rand =parseInt(Math.random()*4)
		switch(rand){
			case 0:	moveStyle="left" ;break;
			case 1:	moveStyle="right" ;break;
			case 2:	moveStyle="down" ;break;
			case 3:	moveStyle="up" ;break;
		}
		$(function(){
			$("#KinSlideshow1").KinSlideshow({moveStyle:moveStyle});
			
		})
	function pageNoId(pageNo){	
			}	
	
		
			 
		</script>
  </head>
  
  <body>
  <%@ include file="/hader.jsp"%> 
    <div class="wrapper">
	<div class="banner fl">
		<div id="KinSlideshow1" style="visibility:hidden;"> 
			<a href="#"><img src="images/banner_01.jpg" alt="" width="724" height="220" /></a> 
			<a href="#"><img src="images/banner_02.jpg" alt="" width="724" height="220" /></a> 
			<a href="#"><img src="images/banner_03.jpg" alt="" width="724" height="220" /></a> 
			<a href="#"><img src="images/banner_04.jpg" alt="" width="724" height="220" /></a> 
		</div>
	</div>
	<div class="banner_right fr"> <a href="#"><img src="images/index_05.jpg" alt="" title="手机版" /></a><a href="#"><img src="images/index_06.jpg" alt="" title="HD版" /></a> </div>
	<div class="cb"></div>
	<form action="/register.do?method=addBusinessDetail" method="post" id="businessinfoForm" enctype="multipart/form-data" > 
	<div class="tjshxx">
		<h2>提交商户信息</h2>
		<div class="cb"></div>
		<div>

			<table cellpadding="0" cellspacing="0" width="100%" border="0">
				<tr>
					<td width="37%" align="right" valign="top">商家帐户：</td>
					<td width="63%" align="left" valign="top">${useremail}</td>
				</tr>
				<tr>
					<td align="right" valign="top">联系人真实姓名：</td>
					<td align="left" valign="top">
					<input id="zsxm" name="realName" path="businessinfo.realName" type="text" class="input1 w147 h19" /><br />
					<span id="zsxmTip"></span><span>请填写您的真实姓名，方便今后客服与您核实身份</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">联系电话：</td>
					<td align="left" valign="top">
						<input  id="sjdh" name="tel"  path="businessinfo.tel" type="text" class="input1 w147 h19" />
						<span id="sjdhTip"></span><br />
						<span>请填写您的直接联系电话，方便今后客服与您核实身份</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">其它联系方式：</td>
					<td align="left" valign="top"><input name="elseTel" path="businessinfo.elseTel" type="text" class="input1 w362 h19" /><br /><span>请您留下您的QQ号或邮箱，方便联系</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">身份证件号码：</td>
					<td align="left" valign="top"><input id="s_f_z_h" name="DocumentsID" path="businessinfo.DocumentsID" type="text" class="input1 w362 h19" /><br />
					<span>请填写真实的证件号码，身份证号码是15或18位数字</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">营业开始时间：</td>
					<td align="left" valign="top"><input name="beginTime" path="businessinfo.beginTime" type="text" class="input1 w147 h19" /><br /><span>本商户每天开始营业的时间</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">营业结束时间：</td>
					<td align="left" valign="top"><input name="endTime" path="businessinfo.endTime" type="text" class="input1 w147 h19" /><br /><span>本商户打烊时间</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">公交信息：</td>
					<td align="left" valign="top">
						<textarea  id="ms" name="busInformation" path="businessinfo.busInformation" cols="" rows="" class="input1 w362 h59"></textarea><br />
						<span id="msTip"></span>
						<span >本商户周边的公交车信息</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">消费提示：</td>
					<td align="left" valign="top">
					<textarea id="xfts" name="Consumption" path="businessinfo.Consumption" cols="" rows="" class="input1 w362 h59"></textarea><br />
						<span id="xftsTip"></span>
					<span>用户在购买前须知的消费说明</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">特色亮点：</td>
					<td align="left" valign="top"><textarea id="tsld" name="Characteristic" path="businessinfo.Characteristic" cols="" rows="" class="input1 w362 h59"></textarea>
					<br /><span id="tsldTip"></span><span>本商户与同行的优势所在</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">商户类型：</td>
					<td align="left" valign="top">
					<select name="BusinessType"  id="xueli" path="businessinfo.BusinessType" class="input1 w128 h20">
						<option>--选择商户类型--</option>
						<option value="1">--KTV--</option>
						<option value="2">--酒吧--</option>
						<option value="3">--别墅聚会--</option>								
						</select>
						<span id="xueliTip" style="width:280px"></span><br />
						</td>
				</tr>
				<tr>
					<td align="right" valign="top">商户名称：</td>
					<td align="left" valign="top">
						<input id="us" name="BusinessName" path="businessinfo.BusinessName" type="text" class="input1 w362 h19" /><br />
						<span id="usTip" ></span></td>
				</tr>
				<tr>
					<td align="right" valign="top">所在城市：</td>
					<td align="left" valign="top">
						<select id="fselect" name="fselect" onchange="set_zlist(this.value);" class="input1 w128 h20">
							<c:forEach items="${flist}" var="flist" >
                     			<option value="${flist.id}">${flist.adressName}</option>
                     		</c:forEach>
						</select>&nbsp;&nbsp;&nbsp;&nbsp;
						<select id="cityAdress" name="cityAdress" style="width:200px;" path="businessinfo.cityAdress" class="input1 w128 h20">
								<c:forEach items="${zlist}" var="zlist" >
                     				<option value="${zlist.id}">${zlist.adressName}</option>
                     			</c:forEach>
						</select>
						 <br /></td>
				</tr>
				<tr>
					<td align="right" valign="top">店面联系电话：</td>
					<td align="left" valign="top">
					<input id="lxdh" name="BusinessTel" path="businessinfo.BusinessTel" type="text" class="input1 w147 h19" />
					<br /><span id="lxdhTip"></span><span>普通会员预约消费时需拨打的商家电话</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">商户地址：</td>
					<td align="left" valign="top">
					<textarea id="shdz" name="BusinessAddress" path="businessinfo.BusinessAddress"  cols="" rows="" class="input1 w362 h59"></textarea><br />
					<span id="shdzTip"></span><span>填写商户详细地址</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">商户座标：</td>
					<td align="left" valign="top"><textarea id="shzb" name="mapurl"  path="businessinfo.mapurl" cols="" rows="" class="input1 w362 h59"></textarea><br />
					<span id="shzbTip"></span><span>填写地图url</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">商户介绍：</td>
					<td align="left" valign="top">
					<textarea id="shjs" name="Introduce"  path="businessinfo.Introduce" cols="" rows="" class="input1 w362 h59"></textarea><br />
					<span id="shjsTip"></span><span>填写商户简介</span></td>
				</tr>
				<tr>
					<td align="right" valign="top">商户照片：</td>
					<td align="left" valign="top">
					<div id="taskFileDiv">
		           		<div class="yzc_upload_img">
						<input id="file_upload_detail" name="file_upload_detail" type="file" />
						</div>
						<div>
						<a href="javascript:$('#file_upload_detail').uploadifyClearQueue()">清除队列</a>
						</div>				
  				  	 </div><span>要求图片格式为480*320像素格式为JPG格式。至少上传一张图片</span></td>
				</tr>
			</table>
		</div>
	</div>
	<div class="cb"></div>
	<div align="center" style="padding-bottom:30px"><input type="submit" value="提交"  class="btn01" /></div>
	<div class="cb"></div>
	</form>
</div>
  </body>
</html>
